package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * 购物车表 实体bean
 */
@TableName("t_purchase")
public class PurchaseBean {
    /** 购物车id */
    @TableId(value = "pk_purchaseId",type = IdType.AUTO)
    private Integer purchaseId;
    /** 商品表外键ID */
    @TableField("fk_stockId")
    private String stockId;
    /** 采购数量 */
    @TableField("p_num")
    private Integer num;
    /** 采购价格 */
    @TableField("p_price")
    private Integer price;
    /** 采购员姓名 */
    @TableField("p_userName")
    private String userName;
    /** 商品实体bean */
    @TableField(exist = false)
    private StockBean stockBean;

    public PurchaseBean() {
    }

    public PurchaseBean(String stockId, Integer num, String userName) {
        this.stockId = stockId;
        this.num = num;
        this.price = price;
        this.userName = userName;
    }

    public Integer getPurchaseId() {
        return purchaseId;
    }

    public void setPurchaseId(Integer purchaseId) {
        this.purchaseId = purchaseId;
    }

    public String getStockId() {
        return stockId;
    }

    public void setStockId(String stockId) {
        this.stockId = stockId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public StockBean getStockBean() {
        return stockBean;
    }

    public void setStockBean(StockBean stockBean) {
        this.stockBean = stockBean;
    }

    @Override
    public String toString() {
        return "PurchaseBean{" +
                "purchaseId=" + purchaseId +
                ", stockId='" + stockId + '\'' +
                ", num=" + num +
                ", price=" + price +
                ", userName='" + userName + '\'' +
                ", stockBean=" + stockBean +
                '}'+'\n';
    }
}
